/*
 * gui.h
 */
#ifndef GUI_H
#define GUI_H

#include <iostream>
#include <utility>
#include <string>
#include <vector>
#include <sstream>

namespace newsclient {

  class Core; //forward declaration
  class Connection;

  class GUI {
  public:

    GUI();

    ~GUI();

    /*
     *The main loop accepting input from the user.
     */
    void input();

    /*
     *Outputs a string to console with cout
     */
    template<typename text_type>
      void println(text_type s) { std::cout << s << std::endl; }

    template<typename text_type>
      void print(text_type s) { std::cout << s; }
     
    /*
     *Add sommands to the commands list
     */
    void addCommand(std::string, std::string);

    /*
     * set the parser variable(pointer)
     */
    void setCore(Core*);

    /*
     *Prints a list of availible commands.
     */
    void printCommands() const;

    /*
     *Handles shutdown of program
     */
    void quit();
    
    bool parse();
  private:
    std::vector<std::pair<std::string, std::string> > cmds;
    Core* core; //Pointer to the core

    /*
     *Method that prints the welcome message upon exec.
     */
    void printWelcome() const;
  };
}
#endif
